<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father{
            width: 200px;
            height: 200px;
            background-color: pink;
            margin: 200px auto;
            /* text-align: center; */
            overflow: hidden;
        }
        .son{
            width: 100px;
            height: 100px;
            background-color: purple;
            margin: 50px;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son"></div>
    </div>
    <script>
        var father = document.querySelector('.father');
        var son = document.querySelector('.son');

        //mouseover 经过子盒子时又会触发
        // father.addEventListener('mouseover',function(){
        //     console.log('11');
        // })

        //mouseenter 只对自身有效，因为不冒泡
        father.addEventListener('mouseenter',function(){
            console.log('11');
        });
        // mouseleave 鼠标离开
    </script>
</body>
</html>